package com.example.controller;

import com.example.bean.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/list")
    public List<User> list(){
        List<User> list = new ArrayList<>();
        User user = new User(111, "Java", "10001000", new Date());
        User user2 = new User(222, "C#", "20001000", new Date());
        User user3 = new User(333, "Python", null, new Date());

        list.add(user);
        list.add(user2);
        list.add(user3);
        return list;
    }

}
